package com.ccb.sc.common.modules.live.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @version 1.0
 * @date 2022-07-30 21:48
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum OfferCategory implements IEnum<Integer> {

    /**
     * offer分类 1买送正装 2买送同款 3买送很多 4直接减钱 5买送正能量
     */
    HANDSEL_GENUINE_PACKAGE(1, "买送正装"),

    HANDSEL_SAME_PARAGRAPH(2, "买送同款"),

    HANDSEL_MANY(3, "买送很多"),

    REDUCE_MONEY_DIRECTLY(4, "直接减钱"),

    HANDSEL_POSITIVE_ENERGY(5, "买送正能量"),

    ;

    private int value;
    private String desc;

    OfferCategory(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static OfferCategory getByValue(int value) {
        for (OfferCategory liveStreamingOrderSource : OfferCategory.values()) {
            if (liveStreamingOrderSource.getValue() == value) {
                return liveStreamingOrderSource;
            }
        }
        return null;
    }
}
